<?php

use think\facade\Route;

Route::group('config', function () {
    Route::get('sdn', '@isSdn');        // 初始化
    Route::get('init', '@initApp');        // 初始化
    Route::get('switch', '@switch');         // 全局开关
    Route::get('login', '@login');          // 登录配置
    Route::get('typeset', '@typeset');        // 排版配置
    Route::get('discovery', '@discovery');      // 发现页
    Route::get('navi/top/list', '@naviTopTree');    // 头部导航
    Route::get('navi/bottom/list', '@naviBottomTree'); // 底部导航
    Route::get('banner', '@getBanner');      // banner图
})->prefix('\app\common\service\Config')->middleware([
        '\app\common\middleware\Init',
        '\app\common\middleware\WithoutLogin',
        '\app\common\middleware\BindLoginUser',
    ]);

// 三方登录
Route::group('config/thirdlogin', function () {
    Route::get('$', '@thirdlogin');         // 配置
    Route::get('check', '@thirdloginCheck');    // 检查用户信息（未绑定返回oauth）
    Route::get('h5bind', '@thirdloginH5bind');   // H5微信登录绑定
    Route::get('openid', '@thirdloginOpenid');   // 微信获取openid
})->prefix('\app\common\service\Config')->middleware([
        '\app\common\middleware\Init',
    ])->pattern(['type' => '\w+']);
